/*
 * Copyright (C), 2002-2017, roy 学习代码
 * FileName: ColumnDto.java
 * Author:   roy
 * Date:     2017年1月5日 下午8:44:54
 * Description: //模块目的、功能描述      
 * History: //修改记录
 * <author>      <time>      <version>    <desc>
 * 修改人姓名             修改时间            版本号                  描述
 */
package com.roy.roycodegenerator.service.generator.dto;

import com.roy.roycodegenerator.common.consts.CamelToUnderScoreTools;
import com.roy.roycodegenerator.common.consts.ColumnTypeToJTypeTool;

/**
 * 〈一句话功能简述〉<br>
 * 〈功能详细描述〉
 *
 * @author roy
 * @see [相关类/方法]（可选）
 * @since [产品/模块版本] （可选）
 */
public class ColumnDto {

    private String columnName;
    private String entityName;
    private String entityIndexUpperName;

    private String columnCommont;
    private String entityCommont;

    private String columnType;
    private String entityType;
    

    /**
     * @return the columnName
     */
    public String getColumnName() {
        return columnName;
    }

    /**
     * @param columnName the columnName to set
     */
    public void setColumnName(String columnName) {
        this.columnName = columnName;
        this.entityName = CamelToUnderScoreTools.camelName(columnName);
        this.entityIndexUpperName = entityName.substring(0, 1).toUpperCase() + entityName.substring(1);
    }

    /**
     * @return the entityName
     */
    public String getEntityName() {
        return entityName;
    }

    /**
     * @param entityName the entityName to set
     */
    public void setEntityName(String entityName) {
        this.entityName = entityName;
    }

    /**
     * @return the columnCommont
     */
    public String getColumnCommont() {
        return columnCommont;
    }

    /**
     * @param columnCommont the columnCommont to set
     */
    public void setColumnCommont(String columnCommont) {
        this.columnCommont = columnCommont;
    }

    /**
     * @return the entityCommont
     */
    public String getEntityCommont() {
        return entityCommont;
    }

    /**
     * @param entityCommont the entityCommont to set
     */
    public void setEntityCommont(String entityCommont) {
        this.entityCommont = entityCommont;
    }

    /**
     * @return the columnType
     */
    public String getColumnType() {
        return columnType;
    }

    /**
     * @param columnType the columnType to set
     */
    public void setColumnType(String columnType) {
        this.columnType = columnType;
        this.setEntityType(null == ColumnTypeToJTypeTool.DATA_RE_MAP.get(columnType) ? columnType
                : ColumnTypeToJTypeTool.DATA_RE_MAP.get(columnType));
    }

    /**
     * @return the entityType
     */
    public String getEntityType() {
        return entityType;
    }

    /**
     * @param entityType the entityType to set
     */
    public void setEntityType(String entityType) {
        this.entityType = entityType;
    }

    /**
     * @return the entityIndexUpperName
     */
    public String getEntityIndexUpperName() {
        return entityIndexUpperName;
    }

    /**
     * @param entityIndexUpperName the entityIndexUpperName to set
     */
    public void setEntityIndexUpperName(String entityIndexUpperName) {
        this.entityIndexUpperName = entityIndexUpperName;
    }

    /*
     * (non-Javadoc)
     * @see java.lang.Object#toString()
     */
    @Override
    public String toString() {
        return "ColumnDto [columnName=" + columnName + ", entityName=" + entityName + ", columnCommont=" + columnCommont
                + ", entityCommont=" + entityCommont + ", columnType=" + columnType + ", entityType=" + entityType
                + "]";
    }

}
